/*
 * Copyright (c) 2025 EasyAdmin
 * All rights reserved.
 *
 * This file is part of the [EasAdmin] project.
 * Unauthorized copying of this file, via any medium, is strictly prohibited.
 * Proprietary and confidential.
 *
 * Author: EasyAdmin ( 1073602@qq.com )
 * Website: https://www.xhxiao.com
 */
package com.easy.module.system.service;

import com.easy.framework.cache.model.Dict;
import com.easy.framework.database.service.IService;
import com.easy.module.system.entity.SysDictData;
import com.easy.module.system.query.SysDictDataQuery;

import java.util.List;

/**
 * 字典数据表 Service接口
 *
 * @author EasyAdmin ( 1073602@qq.com )
 * @date 2025-08-19
 */
public interface ISysDictDataService extends IService<SysDictData, SysDictDataQuery> {

    /**
     * 新增字典数据
     *
     * @param dto 字典数据
     * @return 结果
     */
    boolean add(SysDictData dto);

    /**
     * 修改字典数据
     *
     * @param dto 字典数据
     * @return 结果
     */
    boolean update(SysDictData dto);

    /**
     * 批量删除字典数据
     *
     * @param ids 需要删除的字典数据主键集合
     * @return 结果
     */
    boolean deleteByIds(Long[] ids);


    List<SysDictData> listByCode(String dictType);

    void setDictionaryCache(String code,List<SysDictData> list);

    void setDictionaryCache(String code);

    List<Dict> getDictionaryCache(String code);

    /**
     * 同步修改字典代码
     *
     * @param oldDictType 旧字典代码
     * @param newDictType 新旧字典代码
     * @return 结果
     */
    boolean updateDictCode(String oldDictType, String newDictType);

    /**
     * 查询字典数据
     *
     * @param dictCode 字典代码
     * @return 字典数据
     */
    long countByDictCode(String dictCode);
}
